package com.example.communitypro.mapper;
import com.example.communitypro.pojo.Comment;
import com.example.communitypro.pojo.CommunityInformation;
import com.example.communitypro.pojo.Post;
import com.example.communitypro.pojo.UserLikes;

import java.util.List;

public interface UserLikesMapper {
    int insertUserLikes(UserLikes userLikes); //新增用户点赞
    int deleteUserLikes(int like_id); //删除用户点赞
    //新增和删除点赞会根据点赞对象类型同步增加或减少社区、帖子、评论点赞数
    //like_object_type=0:社区，like_object_type=1:帖子，like_object_type=2:评论
    List<CommunityInformation> getCommunityLike(int user_no);//找到某用户点赞的社区 √
    //like_object_type==0的;
    List<Post> getPostLike(int user_no);//查找某用户点赞的帖子 √
    //like_object_type==1的;
    List<Comment> getCommentLike(int user_no);//查找某用户点赞的评论 √
    //like_object_type==2的
    int deletePostLike(int post_no ); //删除帖子所有点赞
    int deleteCommentLike(int comment_no); //删除评论所有点赞

    UserLikes getUserLikes(int user_no,int like_object_type,int like_object_no);


    /**
     * 系统自动生成
     */
    int deleteByPrimaryKey(Integer likeId);

    int insert(UserLikes record);

    int insertSelective(UserLikes record);

    UserLikes selectByPrimaryKey(Integer likeId);

    int updateByPrimaryKeySelective(UserLikes record);

    int updateByPrimaryKey(UserLikes record);
    List<Integer> findUserToOther(Integer userNo);
    List<Integer> findUserByPost(Integer like_object_no);
}
